#ifndef MAINDIALOG_H
#define MAINDIALOG_H

#include <QDialog>
#include <QAbstractTableModel>
#include <QStringList>
#include <QSignalMapper>
#include <QLabel>
#include <QKeyEvent>

namespace Ui {
class MainDialog;
}

class MainDialog : public QDialog
{
    Q_OBJECT
    
public:
    explicit MainDialog(QWidget *parent = 0);
    ~MainDialog();

public slots:
    void operationSelected(const QString &buttontext);
    void selectCheque();
    void updateHeader();
    void updateHistory(int numRecords);
protected:
    void timerEvent(QTimerEvent *event);
    bool eventFilter(QObject *obj, QEvent *event);

private:
    Ui::MainDialog *ui;
    QSignalMapper *signalMapper;
    QLabel *lbHistory;
    QSharedPointer<QWidget> current;
    QMap<QString,QVariant>variables;
    int timerForClock;
    int timerForUpdate;

    QString firstElement;
    bool isFirstTimeTimer;
};

#endif // MAINDIALOG_H
